Bases: LMOperationalMetric
Reasoning share of output tokens; use to check a model thinks, not quality.
Fraction of completion tokens spent on reasoning:
reasoning_tokens / completion_tokens. Signals whether a thinking
model is actually thinking on the workload.
Example:
program.compile(
metrics=[
synalinks.metrics.ReasoningTokenShare(),
],
)
Source code in synalinks/src/metrics/lm_metrics.py
| @synalinks_export("synalinks.metrics.ReasoningTokenShare")
class ReasoningTokenShare(LMOperationalMetric):
"""Reasoning share of output tokens; use to check a model thinks, not quality.
Fraction of completion tokens spent on reasoning:
reasoning_tokens / completion_tokens. Signals whether a thinking
model is actually thinking on the workload.
Example:
```python
program.compile(
metrics=[
synalinks.metrics.ReasoningTokenShare(),
],
)
```
"""
def __init__(self, name="reasoning_token_share", description=None):
super().__init__(name=name, description=description)
def result(self):
completion = self._delta("completion_tokens")
if completion <= 0:
return 0.0
return self._delta("reasoning_tokens") / completion
|